'use strict';

angular.module('CBO').controller('TerminalListController', ['$scope', 'PublicModule', 'PublicEnum', 'PublicFunction', 'BaseService', '$location', 'Authentication',
    function($scope, PublicModule, PublicEnum, PublicFunction, BaseService, $location, Authentication) {
    	PublicModule.initModule($scope, 'Terminal');
        $scope.Module.Terminal.LoadMode = PublicEnum.LoadMode.CacheAndPaging;
        $scope.Module.Terminal.PageSize = 15;

        $scope.DeviceTypeEnum;
        BaseService.getExtendEnum('DeviceType', function(extendEnum){
            $scope.DeviceTypeEnum = extendEnum;
        });

        $scope.btnAdd = function(){
        	$location.url('/index/Terminal/Edit');
        };

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/Terminal/Edit/" + $scope.Module.Terminal.FocusedRecord._id);
            });
        };

        $scope.btnDelete = function(){
        	$scope.Module.Terminal.deleteSelecteds();
        };
    }
]);